<?php

namespace Admin\Model;

use Zend\InputFilter\InputFilter;
use Zend\InputFilter\Factory as InputFactory;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\InputFilterInterface;

class Lichday implements InputFilterAwareInterface
{
    public $id;
    public $tiet;
    public $tentiet;
	public $thu;
	public $tenthu;
	public $lop;
	public $tenlop;
	public $giaovien;
	public $tengv;
	public $buoi;
	

    protected $inputFilter;

    /**
     * Used by ResultSet to pass each database row to the entity
     */
    public function exchangeArray($data)
    {
        $this->id     = (isset($data['id'])) ? $data['id'] : null;
        $this->thu = (isset($data['thu'])) ? $data['thu'] : null;
        $this->tenthu  = (isset($data['tenthu'])) ? $data['tenthu'] : null;
		$this->tiet  = (isset($data['tiet'])) ? $data['tiet'] : null;
		$this->tentiet  = (isset($data['tentiet'])) ? $data['tentiet'] : null;
		$this->giaovien  = (isset($data['giaovien'])) ? $data['giaovien'] : null;
		$this->tengv  = (isset($data['tengv'])) ? $data['tengv'] : null;
		$this->lop  = (isset($data['lop'])) ? $data['lop'] : null;
		$this->tenlop  = (isset($data['tenlop'])) ? $data['tenlop'] : null;
		$this->buoi  = (isset($data['buoi'])) ? $data['buoi'] : null;
    }

    public function getArrayCopy()
    {
        return get_object_vars($this);
    }

    public function setInputFilter(InputFilterInterface $inputFilter)
    {
        throw new \Exception("Not used");
    }

    public function getInputFilter()
    {
        if (!$this->inputFilter) {
            $inputFilter = new InputFilter();

            $factory = new InputFactory();

            $inputFilter->add($factory->createInput(array(
                'name'     => 'id',
                'required' => true,
                'filters'  => array(
                    array('name' => 'Int'),
                ),
            )));

            
			/*
            $inputFilter->add($factory->createInput(array(
                'name'     => 'tenhs',
                'required' => true,
                'filters'  => array(
                    array('name' => 'StripTags'),
                    array('name' => 'StringTrim'),
                ),
                'validators' => array(
                    array(
                        'name'    => 'StringLength',
                        'options' => array(
                            'encoding' => 'UTF-8',
                            'min'      => 4,
                            'max'      => 16,
							'messages' => array(
                                'stringLengthTooShort' => 'Vui lòng nhập vào từ 4-16 kí tự!', 
                                'stringLengthTooLong' => 'Vui lòng nhập vào từ 4-16 kí tự!' 
                            ),
                        ),
                    ),
                ),
            )));
			*/
			
			$inputFilter->add($factory->createInput(array(
                'name'     => 'lop',
                'required' => true,
                
            )));
			$inputFilter->add($factory->createInput(array(
                'name'     => 'thu',
                'required' => true,
                
            )));
			$inputFilter->add($factory->createInput(array(
                'name'     => 'tiet',
                'required' => true,
                
            )));
			$inputFilter->add($factory->createInput(array(
                'name'     => 'giaovien',
                'required' => true,
                
            )));
			$inputFilter->add($factory->createInput(array(
                'name'     => 'buoi',
                'required' => true,
                
            )));
			
			

            $this->inputFilter = $inputFilter;        
        }

        return $this->inputFilter;
    }
}
